package com.archgeek.bigdata.presto;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.parser.ParserConfig;

import java.util.HashMap;
import java.util.Map;

/**
 * @author pizhihui
 * @date 2022-03-31 15:30
 */
public class Test {

    public static void main(String[] args) {


        String s = "{\"queryId\":\"20220427_082828_05323_npc7h\",\"session\":{\"queryId\":\"20220427_082828_05323_npc7h\",\"transactionId\":\"05cfff13-2613-4ce3-abb4-b577a8771280\",\"clientTransactionSupport\":true,\"user\":\"biadmin\",\"source\":\"presto-jdbc\",\"catalog\":\"hive\",\"timeZoneKey\":2201,\"locale\":\"en_US\",\"remoteUserAddress\":\"10.10.28.250\",\"userAgent\":\"Presto JDBC Driver/0.265.1-ad1fce6\",\"clientTags\":[],\"resourceEstimates\":{},\"startTime\":1651048108297,\"systemProperties\":{},\"catalogProperties\":{},\"unprocessedCatalogProperties\":{},\"roles\":{},\"preparedStatements\":{},\"sessionFunctions\":{}},\"state\":\"FAILED\",\"memoryPool\":\"general\",\"scheduled\":true,\"self\":\"http://10.10.28.137:9000/v1/query/20220427_082828_05323_npc7h\",\"fieldNames\":[\"month01\",\"num_fuid\",\"GMV\",\"fpd7_fz\",\"fpd7_fm\",\"fpd30_fz\",\"fpd30_fm\",\"dpd30_fzmoa3\",\"dpd30_fmmoa3\",\"dpd30_fzmoa6\",\"dpd30_fmmoa6\",\"dpd30_fzmoa9\",\"dpd30_fmmoa9\",\"dpd30_fzmoa12\",\"dpd30_fmmoa12\"],\"query\":\"select\\n    substr(a.fcreate_time,1,7) as month01,\\n    count(distinct a.fuid) as num_fuid,\\n    sum(fgmv_amount) as GMV,\\n    sum(if(b.fpd7_fz=1,b.fpaying_capital,0)) as fpd7_fz,   ---订单金额减去首付\\n    sum(if(b.fpd7_fm=1,b.fgmv_amount,0)) as fpd7_fm,  \\n    \\n    sum(if(b.fpd30_fz=1,b.fpaying_capital,0)) as fpd30_fz,\\n    sum(if(b.fpd30_fm=1,b.fgmv_amount,0)) as fpd30_fm,\\n    \\n    sum(if(d1.fmoa=3 and d1.dpd30_fz=1,d1.fpaying_capital,0)) as dpd30_fzmoa3,\\n    sum(if(d1.fmoa=3 and d1.dpd30_fm=1,d1.famount,0)) as dpd30_fmmoa3,\\n    \\n    sum(if(d1.fmoa=6 and d1.dpd30_fz=1,d1.fpaying_capital,0)) as dpd30_fzmoa6,\\n    sum(if(d1.fmoa=6 and d1.dpd30_fm=1,d1.famount,0)) as dpd30_fmmoa6,\\n    \\n    sum(if(d1.fmoa=9 and d1.dpd30_fz=1,d1.fpaying_capital,0)) as dpd30_fzmoa9,\\n    sum(if(d1.fmoa=9 and d1.dpd30_fm=1,d1.famount,0)) as dpd30_fmmoa9,\\n    \\n    sum(if(d1.fmoa=12 and d1.dpd30_fz=1,d1.fpaying_capital,0)) as dpd30_fzmoa12,\\n    sum(if(d1.fmoa=12 and d1.dpd30_fm=1,d1.famount,0)) as dpd30_fmmoa12\\nfrom \\n(select \\ndistinct forder_id, fuid, fcreate_time\\nfrom dp_fk_mart.fkfx_order_detail  \\n\\twhere forder_state >= 350 and forder_type <> 100 and fpay_way = 0 and bitwise_and(finner_flag,1) = 0 --取交易成功&非激活订单&乐卡支付&剔除测试订单\\n\\t and (fbusiness_one_level_id<>208 or fbusiness_two_level_id=208006) --剔除非我司资产订单\\n\\t and (fbusiness_one_level_id<>208 or fbusiness_three_level_id=2080060001) --剔除非我司资产订单\\n\\t and fbusiness_one_level_id<>1004 --剔除出表资产\\n\\t and fbusiness_two_level_id not in (203001) --剔除支付中心订单 \\n\\t and fbusiness_department_id<>11 --剔除收入订单(如乐花卡权益付费&乐黑卡等) \\n\\t and substr(fcreate_time,1,7)>='2021-01-01'\\n\\t )a\\n\\t left join dp_fkaf_mart.richardgao_order_dpd_fpd b on a.forder_id=b.forder_id \\n     left join \\n    (select * from dp_fkaf_mart.richardgao_order_dpd_fpd_backtrack where f_p_date>='2021-01-01') d1 on a.forder_id=d1.forder_id \\n    group by 1\\n    order by 1 asc limit 100---------elizabethlv -----\",\"queryStats\":{\"createTime\":\"2022-04-27T08:28:28.300Z\",\"executionStartTime\":\"2022-04-27T08:28:28.350Z\",\"lastHeartbeat\":\"2022-04-27T08:36:28.701Z\",\"endTime\":\"2022-04-27T08:36:28.675Z\",\"elapsedTime\":\"8.01m\",\"waitingForPrerequisitesTime\":\"191.80us\",\"queuedTime\":\"25.51us\",\"resourceWaitingTime\":\"9.44us\",\"semanticAnalyzingTime\":\"49.98ms\",\"columnAccessPermissionCheckingTime\":\"37.63us\",\"dispatchingTime\":\"49.95ms\",\"executionTime\":\"8.01m\",\"analysisTime\":\"213.04ms\",\"totalPlanningTime\":\"213.92ms\",\"finishingTime\":\"0.00ns\",\"totalTasks\":344,\"runningTasks\":0,\"peakRunningTasks\":344,\"completedTasks\":344,\"totalDrivers\":19894,\"queuedDrivers\":61,\"runningDrivers\":401,\"blockedDrivers\":6503,\"completedDrivers\":12929,\"cumulativeUserMemory\":367843176191050750,\"cumulativeTotalMemory\":404606086385400190,\"userMemoryReservation\":\"802.29GB\",\"totalMemoryReservation\":\"818.32GB\",\"peakUserMemoryReservation\":\"864.08GB\",\"peakTotalMemoryReservation\":\"881.63GB\",\"peakTaskUserMemory\":\"17.45GB\",\"peakTaskTotalMemory\":\"17.49GB\",\"peakNodeTotalMemory\":\"20.68GB\",\"scheduled\":true,\"totalScheduledTime\":\"13.06h\",\"totalCpuTime\":\"5.44h\",\"retriedCpuTime\":\"0.00ns\",\"totalBlockedTime\":\"41.95d\",\"fullyBlocked\":true,\"blockedReasons\":[],\"totalAllocation\":\"0B\",\"rawInputDataSize\":\"242.67GB\",\"rawInputPositions\":14028682793,\"processedInputDataSize\":\"242.67GB\",\"processedInputPositions\":14028682793,\"outputDataSize\":\"0B\",\"outputPositions\":0,\"writtenOutputPositions\":0,\"writtenOutputLogicalDataSize\":\"0B\",\"writtenOutputPhysicalDataSize\":\"0B\",\"writtenIntermediatePhysicalDataSize\":\"0B\",\"stageGcStatistics\":[{\"stageId\":0,\"stageExecutionId\":0,\"tasks\":1,\"fullGcTasks\":1,\"minFullGcSec\":0,\"maxFullGcSec\":56,\"totalFullGcSec\":56,\"averageFullGcSec\":28},{\"stageId\":1,\"stageExecutionId\":0,\"tasks\":49,\"fullGcTasks\":49,\"minFullGcSec\":0,\"maxFullGcSec\":161,\"totalFullGcSec\":3168,\"averageFullGcSec\":28},{\"stageId\":2,\"stageExecutionId\":0,\"tasks\":49,\"fullGcTasks\":49,\"minFullGcSec\":0,\"maxFullGcSec\":161,\"totalFullGcSec\":3143,\"averageFullGcSec\":28},{\"stageId\":3,\"stageExecutionId\":0,\"tasks\":49,\"fullGcTasks\":49,\"minFullGcSec\":0,\"maxFullGcSec\":161,\"totalFullGcSec\":3168,\"averageFullGcSec\":28},{\"stageId\":4,\"stageExecutionId\":0,\"tasks\":49,\"fullGcTasks\":49,\"minFullGcSec\":0,\"maxFullGcSec\":161,\"totalFullGcSec\":3143,\"averageFullGcSec\":28},{\"stageId\":5,\"stageExecutionId\":0,\"tasks\":49,\"fullGcTasks\":0,\"minFullGcSec\":0,\"maxFullGcSec\":0,\"totalFullGcSec\":0,\"averageFullGcSec\":0},{\"stageId\":6,\"stageExecutionId\":0,\"tasks\":49,\"fullGcTasks\":0,\"minFullGcSec\":0,\"maxFullGcSec\":0,\"totalFullGcSec\":0,\"averageFullGcSec\":0},{\"stageId\":7,\"stageExecutionId\":0,\"tasks\":49,\"fullGcTasks\":36,\"minFullGcSec\":0,\"maxFullGcSec\":161,\"totalFullGcSec\":2044,\"averageFullGcSec\":27}],\"operatorSummaries\":[],\"runtimeStats\":{\"S7-driverCountPerTask\":{\"name\":\"S7-driverCountPerTask\",\"sum\":6018,\"count\":49,\"max\":190,\"min\":64},\"getSplitsTimeNanos\":{\"name\":\"getSplitsTimeNanos\",\"sum\":175524,\"count\":3,\"max\":94488,\"min\":18239},\"S5-driverCountPerTask\":{\"name\":\"S5-driverCountPerTask\",\"sum\":4684,\"count\":49,\"max\":151,\"min\":49},\"S6-driverCountPerTask\":{\"name\":\"S6-driverCountPerTask\",\"sum\":551,\"count\":49,\"max\":14,\"min\":6},\"S5-OrcReadStripeFooterTimeNanos\":{\"name\":\"S5-OrcReadStripeFooterTimeNanos\",\"sum\":604139926,\"count\":7668,\"max\":784696,\"min\":41342},\"S6-OrcReadMetadataTimeNanos\":{\"name\":\"S6-OrcReadMetadataTimeNanos\",\"sum\":24295937,\"count\":551,\"max\":133242,\"min\":29729},\"S5-OrcReadPostScriptTimeNanos\":{\"name\":\"S5-OrcReadPostScriptTimeNanos\",\"sum\":25114462,\"count\":4684,\"max\":207072,\"min\":1272},\"S3-taskElapsedTimeNanos\":{\"name\":\"S3-taskElapsedTimeNanos\",\"sum\":23559053328012,\"count\":49,\"max\":508707926880,\"min\":479806194748},\"S7-OrcReadMetadataTimeNanos\":{\"name\":\"S7-OrcReadMetadataTimeNanos\",\"sum\":180931138,\"count\":5957,\"max\":516679,\"min\":9105},\"S7-OrcReadFooterTimeNanos\":{\"name\":\"S7-OrcReadFooterTimeNanos\",\"sum\":312046234,\"count\":5957,\"max\":4483368,\"min\":20055},\"getLayoutTimeNanos\":{\"name\":\"getLayoutTimeNanos\",\"sum\":13305929,\"count\":8,\"max\":12293658,\"min\":31199},\"S5-taskElapsedTimeNanos\":{\"name\":\"S5-taskElapsedTimeNanos\",\"sum\":579496255370,\"count\":49,\"max\":24388505678,\"min\":9464161890},\"S5-OrcReadFooterTimeNanos\":{\"name\":\"S5-OrcReadFooterTimeNanos\",\"sum\":554811471,\"count\":4684,\"max\":663224,\"min\":61204},\"S6-OrcReadPostScriptTimeNanos\":{\"name\":\"S6-OrcReadPostScriptTimeNanos\",\"sum\":1864894,\"count\":551,\"max\":23031,\"min\":1693},\"S7-taskElapsedTimeNanos\":{\"name\":\"S7-taskElapsedTimeNanos\",\"sum\":15381076318865,\"count\":49,\"max\":480677846055,\"min\":128943298146},\"S0-taskElapsedTimeNanos\":{\"name\":\"S0-taskElapsedTimeNanos\",\"sum\":479920539886,\"count\":1,\"max\":479920539886,\"min\":479920539886},\"S6-OrcReadRowIndexesTimeNanos\":{\"name\":\"S6-OrcReadRowIndexesTimeNanos\",\"sum\":2364094759,\"count\":2786,\"max\":23504683,\"min\":6610},\"S7-OrcReadPostScriptTimeNanos\":{\"name\":\"S7-OrcReadPostScriptTimeNanos\",\"sum\":32453289,\"count\":5957,\"max\":311352,\"min\":1480},\"S4-taskElapsedTimeNanos\":{\"name\":\"S4-taskElapsedTimeNanos\",\"sum\":23531985969486,\"count\":49,\"max\":481003723566,\"min\":479848416354},\"S7-OrcReadRowIndexesTimeNanos\":{\"name\":\"S7-OrcReadRowIndexesTimeNanos\",\"sum\":7997071514,\"count\":17250,\"max\":38646327,\"min\":6220},\"S2-taskElapsedTimeNanos\":{\"name\":\"S2-taskElapsedTimeNanos\",\"sum\":23558486376606,\"count\":49,\"max\":508683199821,\"min\":479809653036},\"S7-OrcReadStripeFooterTimeNanos\":{\"name\":\"S7-OrcReadStripeFooterTimeNanos\",\"sum\":75144801,\"count\":2875,\"max\":247138,\"min\":12557},\"getMaterializedViewTimeNanos\":{\"name\":\"getMaterializedViewTimeNanos\",\"sum\":65263,\"count\":3,\"max\":31351,\"min\":10461},\"S5-OrcReadRowIndexesTimeNanos\":{\"name\":\"S5-OrcReadRowIndexesTimeNanos\",\"sum\":54600085887,\"count\":84348,\"max\":69868086,\"min\":1397},\"S1-driverCountPerTask\":{\"name\":\"S1-driverCountPerTask\",\"sum\":1568,\"count\":49,\"max\":32,\"min\":32},\"S2-driverCountPerTask\":{\"name\":\"S2-driverCountPerTask\",\"sum\":1568,\"count\":49,\"max\":32,\"min\":32},\"S3-driverCountPerTask\":{\"name\":\"S3-driverCountPerTask\",\"sum\":3920,\"count\":49,\"max\":80,\"min\":80},\"S1-taskElapsedTimeNanos\":{\"name\":\"S1-taskElapsedTimeNanos\",\"sum\":23557920979584,\"count\":49,\"max\":508678855917,\"min\":479825425269},\"fragmentPlanTimeNanos\":{\"name\":\"fragmentPlanTimeNanos\",\"sum\":3053585,\"count\":1,\"max\":3053585,\"min\":3053585},\"S4-driverCountPerTask\":{\"name\":\"S4-driverCountPerTask\",\"sum\":1568,\"count\":49,\"max\":32,\"min\":32},\"S6-OrcReadStripeFooterTimeNanos\":{\"name\":\"S6-OrcReadStripeFooterTimeNanos\",\"sum\":12995019,\"count\":398,\"max\":103376,\"min\":21310},\"logicalPlannerTimeNanos\":{\"name\":\"logicalPlannerTimeNanos\",\"sum\":208382983,\"count\":1,\"max\":208382983,\"min\":208382983},\"S0-driverCountPerTask\":{\"name\":\"S0-driverCountPerTask\",\"sum\":17,\"count\":1,\"max\":17,\"min\":17},\"S6-taskElapsedTimeNanos\":{\"name\":\"S6-taskElapsedTimeNanos\",\"sum\":492496844659,\"count\":49,\"max\":23140910453,\"min\":7491000542},\"S6-OrcReadFooterTimeNanos\":{\"name\":\"S6-OrcReadFooterTimeNanos\",\"sum\":28100557,\"count\":551,\"max\":191362,\"min\":32967},\"getViewTimeNanos\":{\"name\":\"getViewTimeNanos\",\"sum\":41817510,\"count\":4,\"max\":21694564,\"min\":15253},\"getTableMetadataTimeNanos\":{\"name\":\"getTableMetadataTimeNanos\",\"sum\":822368,\"count\":3,\"max\":380606,\"min\":215623},\"S5-OrcReadMetadataTimeNanos\":{\"name\":\"S5-OrcReadMetadataTimeNanos\",\"sum\":1666424529,\"count\":4684,\"max\":1909025,\"min\":28113},\"getTableHandleTimeNanos\":{\"name\":\"getTableHandleTimeNanos\",\"sum\":52258,\"count\":3,\"max\":25765,\"min\":12798}},\"spilledDataSize\":\"0B\",\"progressPercentage\":64.98944405348347},\"setSessionProperties\":{},\"resetSessionProperties\":[],\"setRoles\":{},\"addedPreparedStatements\":{},\"deallocatedPreparedStatements\":[],\"clearTransactionId\":false,\"outputStage\":{\"stageId\":\"20220427_082828_05323_npc7h.0\",\"self\":\"http://10.10.28.137:9000/v1/stage/20220427_082828_05323_npc7h.0\",\"latestAttemptExecutionInfo\":{\"state\":\"ABORTED\",\"stats\":{\"schedulingComplete\":\"2022-04-27T08:28:28.611Z\",\"getSplitDistribution\":{\"maxError\":\"NaN\",\"count\":0,\"total\":0,\"p01\":-9223372036854775808,\"p05\":-9223372036854775808,\"p10\":-9223372036854775808,\"p25\":-9223372036854775808,\"p50\":-9223372036854775808,\"p75\":-9223372036854775808,\"p90\":-9223372036854775808,\"p95\":-9223372036854775808,\"p99\":-9223372036854775808,\"min\":9223372036854775807,\"max\":-9223372036854775808,\"avg\":\"NaN\"},\"totalTasks\":1,\"runningTasks\":0,\"completedTasks\":1,\"totalLifespans\":1,\"completedLifespans\":1,\"totalDrivers\":17,\"queuedDrivers\":0,\"runningDrivers\":0,\"blockedDrivers\":17,\"completedDrivers\":0,\"cumulativeUserMemory\":0,\"cumulativeTotalMemory\":0,\"userMemoryReservation\":\"0B\",\"totalMemoryReservation\":\"0B\",\"peakUserMemoryReservation\":\"0B\",\"peakNodeTotalMemoryReservation\":\"18.08GB\",\"totalScheduledTime\":\"391.99us\",\"totalCpuTime\":\"341.97us\",\"retriedCpuTime\":\"0.00ns\",\"totalBlockedTime\":\"2.27h\",\"fullyBlocked\":false,\"blockedReasons\":[],\"totalAllocation\":\"0B\",\"rawInputDataSize\":\"0B\",\"rawInputPositions\":0,\"processedInputDataSize\":\"0B\",\"processedInputPositions\":0,\"bufferedDataSize\":\"0B\",\"outputDataSize\":\"0B\",\"outputPositions\":0,\"physicalWrittenDataSize\":\"0B\",\"gcInfo\":{\"stageId\":0,\"stageExecutionId\":0,\"tasks\":1,\"fullGcTasks\":1,\"minFullGcSec\":0,\"maxFullGcSec\":56,\"totalFullGcSec\":56,\"averageFullGcSec\":28},\"operatorSummaries\":[{\"stageId\":0,\"stageExecutionId\":0,\"pipelineId\":0,\"operatorId\":0,\"planNodeId\":\"784\",\"operatorType\":\"ExchangeOperator\",\"totalDrivers\":16,\"addInputCalls\":0,\"addInputWall\":\"0.00ns\",\"addInputCpu\":\"0.00ns\",\"addInputAllocation\":\"0B\",\"rawInputDataSize\":\"0B\",\"rawInputPositions\":0,\"inputDataSize\":\"0B\",\"inputPositions\":0,\"sumSquaredInputPositions\":0,\"getOutputCalls\":0,\"getOutputWall\":\"0.00ns\",\"getOutputCpu\":\"0.00ns\",\"getOutputAllocation\":\"0B\",\"outputDataSize\":\"0B\",\"outputPositions\":0,\"physicalWrittenDataSize\":\"0B\",\"additionalCpu\":\"0.00ns\",\"blockedWall\":\"0.00ns\",\"finishCalls\":0,\"finishWall\":\"0.00ns\",\"finishCpu\":\"0.00ns\",\"finishAllocation\":\"0B\",\"userMemoryReservation\":\"0B\",\"revocableMemoryReservation\":\"0B\",\"systemMemoryReservation\":\"0B\",\"peakUserMemoryReservation\":\"0B\",\"peakSystemMemoryReservation\":\"0B\",\"peakTotalMemoryReservation\":\"0B\",\"spilledDataSize\":\"0B\",\"info\":{\"@type\":\"exchangeClientStatus\",\"bufferedBytes\":0,\"maxBufferedBytes\":-9223372036854775808,\"averageBytesPerRequest\":0,\"successfulRequestsCount\":181584,\"bufferedPages\":0,\"noMoreLocations\":true,\"pageBufferClientStatuses\":[]},\"runtimeStats\":{}},{\"stageId\":0,\"stageExecutionId\":0,\"pipelineId\":1,\"operatorId\":0,\"planNodeId\":\"891\",\"operatorType\":\"LocalExchangeSourceOperator\",\"totalDrivers\":1,\"addInputCalls\":0,\"addInputWall\":\"0.00ns\",\"addInputCpu\":\"0.00ns\",\"addInputAllocation\":\"0B\",\"rawInputDataSize\":\"0B\",\"rawInputPositions\":0,\"inputDataSize\":\"0B\",\"inputPositions\":0,\"sumSquaredInputPositions\":0,\"getOutputCalls\":0,\"getOutputWall\":\"0.00ns\",\"getOutputCpu\":\"0.00ns\",\"getOutputAllocation\":\"0B\",\"outputDataSize\":\"0B\",\"outputPositions\":0,\"physicalWrittenDataSize\":\"0B\",\"additionalCpu\":\"0.00ns\",\"blockedWall\":\"0.00ns\",\"finishCalls\":0,\"finishWall\":\"0.00ns\",\"finishCpu\":\"0.00ns\",\"finishAllocation\":\"0B\",\"userMemoryReservation\":\"0B\",\"revocableMemoryReservation\":\"0B\",\"systemMemoryReservation\":\"0B\",\"peakUserMemoryReservation\":\"0B\",\"peakSystemMemoryReservation\":\"0B\",\"peakTotalMemoryReservation\":\"0B\",\"spilledDataSize\":\"0B\",\"runtimeStats\":{}},{\"stageId\":0,\"stageExecutionId\":0,\"pipelineId\":0,\"operatorId\":1,\"planNodeId\":\"891\",\"operatorType\":\"LocalExchangeSinkOperator\",\"totalDrivers\":16,\"addInputCalls\":0,\"addInputWall\":\"0.00ns\",\"addInputCpu\":\"0.00ns\",\"addInputAllocation\":\"0B\",\"rawInputDataSize\":\"0B\",\"rawInputPositions\":0,\"inputDataSize\":\"0B\",\"inputPositions\":0,\"sumSquaredInputPositions\":0,\"getOutputCalls\":0,\"getOutputWall\":\"0.00ns\",\"getOutputCpu\":\"0.00ns\",\"getOutputAllocation\":\"0B\",\"outputDataSize\":\"0B\",\"outputPositions\":0,\"physicalWrittenDataSize\":\"0B\",\"additionalCpu\":\"0.00ns\",\"blockedWall\":\"0.00ns\",\"finishCalls\":0,\"finishWall\":\"0.00ns\",\"finishCpu\":\"0.00ns\",\"finishAllocation\":\"0B\",\"userMemoryReservation\":\"0B\",\"revocableMemoryReservation\":\"0B\",\"systemMemoryReservation\":\"0B\",\"peakUserMemoryReservation\":\"0B\",\"peakSystemMemoryReservation\":\"0B\",\"peakTotalMemoryReservation\":\"0B\",\"spilledDataSize\":\"0B\",\"runtimeStats\":{}},{\"stageId\":0,\"stageExecutionId\":0,\"pipelineId\":1,\"operatorId\":1,\"planNodeId\":\"731\",\"operatorType\":\"TopNOperator\",\"totalDrivers\":1,\"addInputCalls\":0,\"addInputWall\":\"0.00ns\",\"addInputCpu\":\"0.00ns\",\"addInputAllocation\":\"0B\",\"rawInputDataSize\":\"0B\",\"rawInputPositions\":0,\"inputDataSize\":\"0B\",\"inputPositions\":0,\"sumSquaredInputPositions\":0,\"getOutputCalls\":1,\"getOutputWall\":\"11.55us\",\"getOutputCpu\":\"10.79us\",\"getOutputAllocation\":\"0B\",\"outputDataSize\":\"0B\",\"outputPositions\":0,\"physicalWrittenDataSize\":\"0B\",\"additionalCpu\":\"0.00ns\",\"blockedWall\":\"0.00ns\",\"finishCalls\":0,\"finishWall\":\"0.00ns\",\"finishCpu\":\"0.00ns\",\"finishAllocation\":\"0B\",\"userMemoryReservation\":\"0B\",\"revocableMemoryReservation\":\"0B\",\"systemMemoryReservation\":\"0B\",\"peakUserMemoryReservation\":\"0B\",\"peakSystemMemoryReservation\":\"0B\",\"peakTotalMemoryReservation\":\"0B\",\"spilledDataSize\":\"0B\",\"runtimeStats\":{}},{\"stageId\":0,\"stageExecutionId\":0,\"pipelineId\":1,\"operatorId\":2,\"planNodeId\":\"35\",\"operatorType\":\"TaskOutputOperator\",\"totalDrivers\":1,\"addInputCalls\":0,\"addInputWall\":\"0.00ns\",\"addInputCpu\":\"0.00ns\",\"addInputAllocation\":\"0B\",\"rawInputDataSize\":\"0B\",\"rawInputPositions\":0,\"inputDataSize\":\"0B\",\"inputPositions\":0,\"sumSquaredInputPositions\":0,\"getOutputCalls\":0,\"getOutputWall\":\"0.00ns\",\"getOutputCpu\":\"0.00ns\",\"getOutputAllocation\":\"0B\",\"outputDataSize\":\"0B\",\"outputPositions\":0,\"physicalWrittenDataSize\":\"0B\",\"additionalCpu\":\"0.00ns\",\"blockedWall\":\"0.00ns\",\"finishCalls\":0,\"finishWall\":\"0.00ns\",\"finishCpu\":\"0.00ns\",\"finishAllocation\":\"0B\",\"userMemoryReservation\":\"0B\",\"revocableMemoryReservation\":\"0B\",\"systemMemoryReservation\":\"0B\",\"peakUserMemoryReservation\":\"0B\",\"peakSystemMemoryReservation\":\"0B\",\"peakTotalMemoryReservation\":\"0B\",\"spilledDataSize\":\"0B\",\"runtimeStats\":{}}],\"runtimeStats\":{\"taskElapsedTimeNanos\":{\"name\":\"taskElapsedTimeNanos\",\"sum\":479920539886,\"count\":1,\"max\":479920539886,\"min\":479920539886},\"driverCountPerTask\":{\"name\":\"driverCountPerTask\",\"sum\":17,\"count\":1,\"max\":17,\"min\":17}}},\"tasks\":[]},\"previousAttemptsExecutionInfos\":[],\"subStages\":[],\"runtimeOptimized\":false},\"failureInfo\":{\"type\":\"com.facebook.presto.spi.PrestoException\",\"message\":\"Query exceeded the maximum execution time limit of 8.00m defined at the QUERY level\",\"suppressed\":[],\"stack\":[\"com.facebook.presto.execution.QueryTracker.enforceTimeLimits(QueryTracker.java:226)\",\"com.facebook.presto.execution.QueryTracker.lambda$start$0(QueryTracker.java:105)\",\"java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\",\"java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)\",\"java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)\",\"java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)\",\"java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\",\"java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\",\"java.lang.Thread.run(Thread.java:748)\"],\"errorCode\":{\"code\":131075,\"name\":\"EXCEEDED_TIME_LIMIT\",\"type\":\"INSUFFICIENT_RESOURCES\",\"retriable\":false}},\"warnings\":[{\"warningCode\":{\"code\":3,\"name\":\"PERFORMANCE_WARNING\"},\"message\":\"COUNT(DISTINCT xxx) can be a very expensive operation when the cardinality is high for xxx. In most scenarios, using approx_distinct instead would be enough\"}],\"inputs\":[{\"connectorId\":\"hive\",\"schema\":\"dp_edw\",\"table\":\"ddfx_order_detail\",\"connectorInfo\":{\"partitionIds\":[\"<UNPARTITIONED>\"],\"truncated\":false},\"columns\":[{\"name\":\"fbusiness_department_id\",\"type\":\"integer\"},{\"name\":\"fcreate_time\",\"type\":\"timestamp\"},{\"name\":\"forder_type\",\"type\":\"integer\"},{\"name\":\"fbusiness_two_level_id\",\"type\":\"bigint\"},{\"name\":\"forder_id\",\"type\":\"varchar\"},{\"name\":\"forder_state\",\"type\":\"integer\"},{\"name\":\"fbusiness_one_level_id\",\"type\":\"integer\"},{\"name\":\"fpay_way\",\"type\":\"integer\"},{\"name\":\"fuid\",\"type\":\"integer\"},{\"name\":\"fbusiness_three_level_id\",\"type\":\"bigint\"},{\"name\":\"finner_flag\",\"type\":\"integer\"}],\"statistics\":{\"rowCount\":{\"value\":\"NaN\"},\"totalSize\":{\"value\":\"NaN\"},\"columnStatistics\":{}}},{\"connectorId\":\"hive\",\"schema\":\"dp_fkaf_mart\",\"table\":\"richardgao_order_dpd_fpd\",\"connectorInfo\":{\"partitionIds\":[\"<UNPARTITIONED>\"],\"truncated\":false},\"columns\":[{\"name\":\"fpd30_fm\",\"type\":\"integer\"},{\"name\":\"fpaying_capital\",\"type\":\"double\"},{\"name\":\"fpd7_fz\",\"type\":\"integer\"},{\"name\":\"fgmv_amount\",\"type\":\"double\"},{\"name\":\"forder_id\",\"type\":\"varchar\"},{\"name\":\"fpd30_fz\",\"type\":\"integer\"},{\"name\":\"fpd7_fm\",\"type\":\"integer\"}],\"statistics\":{\"rowCount\":{\"value\":\"NaN\"},\"totalSize\":{\"value\":\"NaN\"},\"columnStatistics\":{}}},{\"connectorId\":\"hive\",\"schema\":\"dp_fkaf_mart\",\"table\":\"richardgao_order_dpd_fpd_backtrack\",\"connectorInfo\":{\"partitionIds\":[\"f_p_date=2021-01-01\",\"f_p_date=2021-02-01\",\"f_p_date=2021-03-01\",\"f_p_date=2021-04-01\",\"f_p_date=2021-05-01\",\"f_p_date=2021-06-01\",\"f_p_date=2021-07-01\",\"f_p_date=2021-08-01\",\"f_p_date=2021-09-01\",\"f_p_date=2021-10-01\",\"f_p_date=2021-11-01\",\"f_p_date=2021-12-01\",\"f_p_date=2022-01-01\",\"f_p_date=2022-02-01\",\"f_p_date=2022-03-01\",\"f_p_date=2022-04-01\"],\"truncated\":false},\"columns\":[{\"name\":\"fmoa\",\"type\":\"integer\"},{\"name\":\"fpaying_capital\",\"type\":\"double\"},{\"name\":\"dpd30_fm\",\"type\":\"integer\"},{\"name\":\"forder_id\",\"type\":\"varchar\"},{\"name\":\"dpd30_fz\",\"type\":\"integer\"},{\"name\":\"famount\",\"type\":\"double\"}],\"statistics\":{\"rowCount\":{\"value\":\"NaN\"},\"totalSize\":{\"value\":\"NaN\"},\"columnStatistics\":{}}}],\"resourceGroupId\":[\"global\",\"adhoc_biadmin\"],\"queryType\":\"SELECT\",\"failedTasks\":[],\"addedSessionFunctions\":{},\"removedSessionFunctions\":[],\"errorType\":\"INSUFFICIENT_RESOURCES\",\"finalQueryInfo\":true}";

        ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
        JSONObject obj = JSONObject.parseObject(s);
        String queryId1 = (String) obj.getOrDefault("queryId", "");
        String state = (String) obj.getOrDefault("state", "");
        String queryType = (String) obj.getOrDefault("queryType", "");
        String errorType = (String) obj.getOrDefault("errorType", "");
        JSONObject errorCode = (JSONObject) obj.getOrDefault("errorCode", new JSONObject());
        JSONArray warnings = (JSONArray) obj.getOrDefault("warnings", new JSONArray());
        JSONArray resourceGroupId = (JSONArray) obj.getOrDefault("resourceGroupId", new JSONArray());
        JSONObject failureInfo = (JSONObject) obj.getOrDefault("failureInfo", new JSONObject());
        JSONArray failedTasks = (JSONArray) obj.getOrDefault("failedTasks", new JSONArray());


        System.out.println(queryId1);
        System.out.println(state);
        System.out.println(queryType);
        System.out.println(errorType);
        System.out.println(errorCode);
        System.out.println(warnings);
        System.out.println(resourceGroupId);
        System.out.println(failureInfo);
        System.out.println(failedTasks);

    }

}
